Constants

DEFAULT_SKIN

DEFAULT_SKIN = 'elastic'

Properties

$system_skin

$system_skin : string

Type

string — A skin configured in the config file (before being replaced by a user preference)

$env

$env

$paths

$paths

$prop

$prop

$errors

$errors

$userprefs

$userprefs

$immutable

$immutable

$client_tz

$client_tz

$legacy_props

$legacy_props : array

Renamed options

Type

array

Methods

__construct()

__construct(string  $env = '') : mixed

Object constructor

Parameters

string $env

Environment suffix for config files to load

Returns

mixed —

load_from_file()

load_from_file(string  $file) : bool

Read configuration from a file and merge with the already stored config values

Parameters

string $file

Name of the config file to be loaded

Returns

bool —

True on success, false on failure

resolve_paths()

resolve_paths(string  $file, bool  $use_env = true) : array

Helper method to resolve absolute paths to the given config file.

This also takes the 'env' property into account.

Parameters

string $file

Filename or absolute file path

bool $use_env

Return -$env file path if exists

Returns

array —

List of candidates in config dir path(s)

get()

get(string  $name, mixed  $def = null) : mixed

Getter for a specific config parameter

Parameters

string $name

Parameter name

mixed $def

Default value if not set

Returns

mixed —

The requested config value

set()

set(string  $name, mixed  $value, bool  $immutable = false) : mixed

Setter for a config parameter

Parameters

string $name

Parameter name

mixed $value

Parameter value

bool $immutable

Make the value immutable

Returns

mixed —

merge()

merge(array  $prefs) : mixed

Override config options with the given values (e.g. user prefs)

Parameters

array $prefs

Hash array with config props to merge over

Returns

mixed —

set_user_prefs()

set_user_prefs(array  $prefs) : mixed

Merge the given prefs over the current config and make sure that they survive further merging.

Parameters

array $prefs

Hash array with user prefs

Returns

mixed —

all()

all() : array

Getter for all config options.

Unlike get() this method does not resolve any special values like e.g. 'timezone'.

It is discouraged to use this method outside of Roundcube core.

Returns

array —

Hash array containing all config properties

transient_options()

transient_options() : array

Some options set as immutable that are also listed in dont_override should not be stored permanently in user preferences. Here's the list of these

Returns

array —

List of transient options

get_timezone()

get_timezone() : float

Special getter for user's timezone offset including DST

Returns

float —

Timezone offset (in hours)

get_crypto_key()

get_crypto_key(string  $key) : string

Return requested DES crypto key.

Parameters

string $key

Crypto key name

Returns

string —

Crypto key

get_crypto_method()

get_crypto_method() : string

Return configured crypto method.

Returns

string —

Crypto method

header_delimiter()

header_delimiter() : string

Try to autodetect operating system and find the correct line endings

Returns

string —

The appropriate mail header delimiter

keyservers()

keyservers() : array|null

Returns list of configured PGP key servers

Returns

array|null —

List of keyservers' URLs

mail_domain()

mail_domain(string  $host, bool  $encode = true) : string

Return the mail domain configured for the given host

Parameters

string $host

IMAP host

bool $encode

If true, domain name will be converted to IDN ASCII

Returns

string —

Resolved SMTP host

get_error()

get_error() : mixed

Getter for error state

Returns

mixed —

Error message on error, False if no errors

timezone_name_from_abbr()

timezone_name_from_abbr(float  $offset) : string|null

timezone_name_from_abbr() replacement. Converts timezone offset into timezone name abbreviation.

Parameters

float $offset

Timezone offset (in hours)

Returns

string|null —

Timezone abbreviation

resolve_timezone_alias()

resolve_timezone_alias(string  $tzname) : string

Replace deprecated timezone name with a valid one.

Parameters

string $tzname

Timezone name

Returns

string —

Timezone name

guess_type()

guess_type(string  $value) : string

Looks inside the string to determine what type might be best as a container.

Parameters

string $value

The value to inspect

Returns

string —

The guessed type.

parse_env()

parse_env(string  $string, string  $type = null) : mixed

Parse environment variable into PHP type.

Parameters

string $string

String to parse into PHP type

string $type

Type of value to return

Returns

mixed —

Appropriately typed interpretation of $string.

getenv_default()

getenv_default(string  $varname, mixed  $default_value, string  $type = null) : mixed

Get environment variable value.

Retrieve an environment variable's value or if it's not found, return the provided default value.

Parameters

string $varname

Environment variable name

mixed $default_value

Default value to return if necessary

string $type

Type of value to return

Returns

mixed —

Value of the environment variable or default if not found.

load()

load() : mixed

Load config from local config file

Returns

mixed —

load_host_config()

load_host_config() : mixed

Load a host-specific config file if configured This will merge the host specific configuration with the given one

Returns

mixed —

client_timezone()

client_timezone() : mixed

Internal getter for client's (browser) timezone identifier

Returns

mixed —

fix_legacy_props()

fix_legacy_props(array  $props) : array

Convert legacy options into new ones

Parameters

array $props

Hash array with config props

Returns

array —

Converted config props